package com.xhsj.user.hr.system.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhsj.user.hr.system.entity.TbHrApprovalDimissionApply;
import com.xhsj.user.hr.system.vo.DemandApplyAuditTaskVo;
import org.apache.ibatis.annotations.Mapper;
import com.xhsj.user.hr.system.entity.TbHrDemandApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * <p>
 * 需求申请表 Mapper 接口
 * </p>
 *
 * @author suxiaolin
 * @since 2020-11-11
 */
@Mapper
public interface TbHrDemandApplyMapper extends BaseMapper<TbHrDemandApply> {

    /**
     * 通过id删除数据
     * @author 苏小林
     * @date 2020/11/11 17:59
     * @param: id
     */
    void delById(@Param("id") Long id);

    /**
     * 查询待审核任务
     * @author 苏小林
     * @date 2020/11/16 10:46
     * @param: page
     * @param: userId
     * @param: roleIds
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.xhsj.user.hr.system.vo.DemandApplyAuditTaskVo>
     */
    IPage<DemandApplyAuditTaskVo> findDemandApplyRunTask(Page<TbHrApprovalDimissionApply> page,
                                                         @Param("userId") Long userId,
                                                         @Param("roleIds") List<Long> roleIds);

    /**
     * 查询历史任务
     * @author 苏小林
     * @date 2020/11/16 13:31
     * @param: page
     * @param: userId
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.xhsj.user.hr.system.vo.DemandApplyAuditTaskVo>
     */
    IPage<DemandApplyAuditTaskVo> findDemandApplyHiTask(Page<TbHrApprovalDimissionApply> page, @Param("userId") Long userId);
}
